/*
	Copyright (C) 2009 Salil Bhagurkar
*/

#include <shared.h>

static struct module_import *m;

static int kinterface_write(struct fs *referrer, struct fs *this, void *buf, u32 offset, u32 count)
{
	switch(offset) {
		case DRIVER_START:
			m = this->data; //Get the module_import struct
			m->printk("Module import success\n");
			return 0;
		
		case DRIVER_STOP:
			return 0;
		
		case DRIVER_PROBE:
			return 0;
		
		default:
			return ENOSUP;;
	}
}

static int kinterface_read(struct fs *referrer, struct fs *this, void *buf, u32 offset, u32 count)
{
	return ENOSUP;
}

static struct fs_system k3_module_system = {FS_SYSTEM_RESOURCE_INIT, .flags = 0, .read = kinterface_read, .write = kinterface_write, FS_SYSTEM_EVENT_INIT};
struct fs k3_module = {.name = "kinterface", .system = &k3_module_system, .flags = 0, DATA_INIT, LINK_INIT, EXEC_INIT};
